package com.linkgie.galaxyframework.utils.concurrent;

import java.util.concurrent.Callable;

public interface SynchronizingSerivce {

     /**
      * 基于 key 进行全局同步；
      * 
      * @param key
      * @param runnable
      */
     void synchronize(String key, Runnable runnable);

     /**
      * 基于 key 进行全局同步；
      * 
      * @param <T>
      * @param key
      * @param callable
      * @return
      */
     <T> T synchronize(String key, Callable<T> callable) throws SynchronizingException;

}
